<template>
  <d2-container>
  <div class="adminSetting">
    <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
      <el-tab-pane label="网站设置" name="form">
        <el-form ref="form" label-width="80px" style="width: 330px">
          <el-form-item label="网站名称">
            <el-input v-model="title"></el-input>
          </el-form-item>
          <el-form-item label="">
            <el-button @click="setTitle" type="primary">
              提交
            </el-button>
          </el-form-item>
        </el-form>
      </el-tab-pane>
    </el-tabs>
  </div>
  </d2-container>
</template>

<script>
export default {
  name: "Setting",
  data() {
    return {
      activeName: "form",
      form: {
        name: "",
        qq: ""
      },
      wechatform: {
        appid: ""
      },
      userInfo: {},
      title: ""
    };
  },
  methods: {
    setTitle() {
      let _this = this;
      localStorage.setItem("currentTitle", _this.title);
      // _this.$http
      //   .post("/api/api.php", {
      //     id: "setTitle",
      //     title: _this.title
      //   })
      //   .then(function(response) {
      //     _this.$message({
      //       type: "success",
      //       message: "成功"
      //     });

      //     setTimeout(function() {
      //       window.location = "/setting";
      //     }, 500);
      //   });
    },
    getUserInfo() {
      let _this = this;
      // _this.$http
      //   .post("/api/api.php", {
      //     id: "getUserInfo"
      //   })
      //   .then(function(response) {
      //     _this.userInfo = response.data.data;
      //     _this.title = _this.userInfo.title;
      //   });
    }
  },
  mounted() {
    this.getUserInfo();
  }
};
</script>

<style lang="scss">
.adminSetting {
  .el-tabs {
    width: 24%;
    margin: 0 auto;
  }
}
</style>
